//auto gen by paipai.java.augogen ver 154
//author floatman
#ifndef _ACCOUNTAO_ACCOUNT_H_
#define _ACCOUNTAO_ACCOUNT_H_

#include <stdint.h>
#include <string>
#include <iostream>
#include "app_platform/help_macros.h"
#include "app_platform/intf_service.h"
#include "intf_accountao.h"

#include "library/basic/singleton_t.h"
#include "library/basic/sync_lock.h"
#include "c2cent/library/log/CWTimeElf3.h"

#include <vector>
#include <set>
#include <map>
#include "erp/account/po/businessunitsfilterpo_account.h"
#include "erp/account/po/businessunitspo_account.h"
#include "erp/account/po/contactfilterpo_account.h"
#include "erp/account/po/contactpo_account.h"
#include "erp/account/po/customercreditpo_account.h"
#include "erp/account/po/employeefilterpo_account.h"
#include "erp/account/po/employeepo_account.h"

HEADER_SELF_DEFINE_START
/**
*  请在这里增加自定义包含的头文件，否则无法合并代码
**/
#include "erp/account/dao/accountdao_stub4app_allinone.h"
HEADER_SELF_DEFINE_END

namespace erp
{
namespace account
{
namespace ao
{

#define ACCOUNTAO_SERVICE_VERSION "ERP_ACCOUNT_AO___ACCOUNTAO__SERVICE_VERSION__1.0 2013-10-29 18:53:40"
const std::string ACCOUNTAO_SERVICE_NOUSE = ACCOUNTAO_SERVICE_VERSION;

SERVICE class CAccountAo : public IAccountAo{
public:
		CAccountAo(enum DeployMethod method = DEPLOY_STANDALONE);
		~CAccountAo();
		 void Reset();
		static int Initialize(IUserDefineCntl* pCntl = NULL);

public:
	 /**
	 *
	 *   添加/修改来往单位；传入来往单位SysNo不为0时则进行修改，反之则进行添加；
	 *
	 */
	EXPORT(0xc06a1801) uint32_t ModifyBusinessUnits(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::account::po::CBusinessUnitsPo& oBusinessUnitsPo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint64_t& ddwSysNo,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   删除来往单位（逻辑）
	 *
	 */
	EXPORT(0xc06a1802) uint32_t DeleteBusinessUnits(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 uint64_t ddwBusinessUnitsSysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   根据分支机构ID批量获取分支机构信息
	 *
	 */
	EXPORT(0xc06a1803) uint32_t GetBusinessUnitsBySysNos(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const std::set<uint64_t> & setBusinessUnitsSysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::map<uint64_t,uint32_t> & mapErrorCode,
		 std::map<uint64_t,std::string> & mapErrorMsg,
		 std::map<uint64_t,erp::account::po::CBusinessUnitsPo> & mapBusinessUnitsPo,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   根据过滤条件查询来往单位列表信息
	 *
	 */
	EXPORT(0xc06a1804) uint32_t GetBusinessUnitsByFilter(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::account::po::CBusinessUnitsFilterPo& oFilter,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint32_t& dwTotal,
		 std::vector<erp::account::po::CBusinessUnitsPo> & vecBusinessUnitsPo,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   添加/修改职员；传入来往单位SysNo不为0时则进行修改，反之则进行添加；
	 *
	 */
	EXPORT(0xc06a1805) uint32_t ModifyEmployee(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::account::po::CEmployeePo& oEmployeePo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint64_t& ddwSysNo,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   删除职员（逻辑）
	 *
	 */
	EXPORT(0xc06a1806) uint32_t DeleteEmployee(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 uint64_t ddwEmployeeSysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   根据职员ID批量获取职员信息
	 *
	 */
	EXPORT(0xc06a1807) uint32_t GetEmployeeBySysNos(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const std::set<uint64_t> & setEmployeeSysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::map<uint64_t,uint32_t> & mapErrorCode,
		 std::map<uint64_t,std::string> & mapErrorMsg,
		 std::map<uint64_t,erp::account::po::CEmployeePo> & mapEmployeePo,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   根据过滤条件查询职员列表信息
	 *
	 */
	EXPORT(0xc06a1808) uint32_t GetEmployeeByFilter(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::account::po::CEmployeeFilterPo& oFilter,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint32_t& dwTotal,
		 std::vector<erp::account::po::CEmployeePo> & vecBusinessUnitsPo,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   根据主键查询信用额度
	 *
	 */
	EXPORT(0xc06a1809) uint32_t GetCustomerCredit(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 uint64_t ddwBranchSysNo,
		 uint64_t ddwBusinessUnitsSysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 erp::account::po::CCustomerCreditPo& oCustomerCreditPo,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   添加/修改信用额度；传入组合主键往来单位SysNo和分支机构SysNo
	 *
	 */
	EXPORT(0xc06a180a) uint32_t ModifyCustomerCredit(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::account::po::CCustomerCreditPo& oCustomerCreditPo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   添加/修改联系人；传入联系人SysNo不为0时则进行修改，反之则进行添加；
	 *
	 */
	EXPORT(0xc06a180b) uint32_t ModifyContact(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::account::po::CContactPo& oContactPo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint64_t& ddwSysNo,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   删除联系人（逻辑）
	 *
	 */
	EXPORT(0xc06a180c) uint32_t DeleteContact(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 uint64_t ddwContactSysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   根据联系人SysNo批量获取联系人信息
	 *
	 */
	EXPORT(0xc06a180d) uint32_t GetContactBySysNos(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const std::set<uint64_t> & setContactSysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::map<uint64_t,uint32_t> & mapErrorCode,
		 std::map<uint64_t,std::string> & mapErrorMsg,
		 std::map<uint64_t,erp::account::po::CContactPo> & mapContactPo,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   根据过滤条件查询联系人信息
	 *
	 */
	EXPORT(0xc06a180e) uint32_t GetContactByFilter(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::account::po::CContactFilterPo& oFilter,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint32_t& dwTotal,
		 std::vector<erp::account::po::CContactPo> & vecContactPo,
		 std::string& strOutReserve
		);

SECTION_SELF_DEFINE_START
/**
* 请在这里增加自定义的成员变量和函数，否则无法合并代码
**/

private:
	uint32_t CheckCommPara(
				const CCntlInfo& rCntlInfo,
				const std::string& strMachineKey,
				const std::string& strSource,
				uint32_t dwSceneId);

	uint32_t CheckBusinessUnitsFilter(const erp::account::po::CBusinessUnitsFilterPo& oBusinessUnitsFilter);

	uint32_t CheckBusinessUnits(const erp::account::po::CBusinessUnitsPo& oBusinessUnitsPo);

private:

	erp::account::dao::CAccountDaoStub4App m_cAccountDaoStub4App;
SECTION_SELF_DEFINE_END

private:
	enum DeployMethod m_method;
};

}
}
}

#endif /* _ACCOUNTAO_ACCOUNT_H_ */
